<!DOCTYPE html>
<html>
<head>
<style>
.absolute {
    position: absolute;
}

.inlineBlock {
    display: inline-block;
}
</style>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<p id="console"></p>
<p>
    <span></span><div>1</div>
    <span></span><div>2</div>
    <span></span><div>3</div>
</p>
<script>
function applyClass(items, className) {
    for (var i = items.length - 1; i >= 0; i--) {
        items[i].classList.add(className)
    };
};

description("The numbers below should be on the same line.")

document.body.offsetTop;
var divs = document.getElementsByTagName("div");
var spans = document.getElementsByTagName("span");
applyClass(spans, "absolute");
applyClass(divs, "inlineBlock");
shouldBe("divs[2].offsetTop", "divs[0].offsetTop");
</script>
</body>